#ifndef _KFIFO_H_
#define _KFIFO_H_

struct kfifo {
    unsigned char *buffer;    /* the buffer holding the data */
    unsigned int size;    /* the size of the allocated buffer */
    unsigned int in;    /* data is added at offset (in % size) */
    unsigned int out;    /* data is extracted from off. (out % size) */
};


void kfifo_init(struct kfifo *fifo, unsigned char *buffer, unsigned int size);


unsigned int __kfifo_put(struct kfifo *fifo, unsigned char *buffer, unsigned int len);


unsigned int __kfifo_get(struct kfifo *fifo, unsigned char *buffer, unsigned int len);


#endif

